package org.student.entity ;

/**
 * 项目名称:
 * 类名称: PageInfo
 * 类描述: 分页对象
 * 创建人：严植培
 * 创建时间: 2011-9-1 下午02:45:55
 */
public class PageInfo {

	private int totalPage = 1 ; // 总页数
	private int prePage = 1 ; // 前一页
	private int nextPage = 1 ; // 下一页
	private int totalRec = 0 ; // 总记录数
	private final int defaultPageSize = 5 ; // 默认显示行数
	private int pageSize = defaultPageSize ; // 显示行数
	private int pageIndex = 1 ; // 当前页
	private int[] pageNumbers ; // 页码

	public int getPageIndex() {
		return pageIndex;
	}

	public void setPageIndex(int pageIndex) {
		this.pageIndex = pageIndex > 0 ? pageIndex : 1;
	}

	public int getNextPage() {
		return nextPage;
	}

	public void setNextPage(int nextPage) {
		this.nextPage = nextPage > this.totalPage ? this.totalPage : nextPage;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize > 0 ? pageSize : 10;
	}

	public int getPrePage() {
		return prePage;
	}

	public void setPrePage(int prePage) {
		this.prePage = prePage < 1 ? 1 : prePage;
	}

	public int getTotalPage() {
		return totalPage;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage > 0 ? totalPage : 1;
	}

	public int getTotalRec() {
		return totalRec;
	}

	public void setTotalRec(int totalRec) {
		this.totalRec = totalRec > -1 ? totalRec : 0;
	}

	public int[] getPageNumbers() {
		return pageNumbers;
	}

	public void setPageNumbers(int[] pageNumbers) {
		this.pageNumbers = pageNumbers;
	}

}
